import { showRole } from "@/werewolf/func";
import { WereWolfModule } from "@/werewolf/module";
import { WereWolfFirstDayPhase } from "@/werewolf/phases/firstDay";

export class showRoleClassicView extends WereWolfModule.Component<
    unknown,
    WereWolfFirstDayPhase
> {
    get players() {
        return this.context.players;
    }

    override onAttach(): void {
        this.runner.run(async (r) => {
            this.players.forEach((p) => p.clear("werewolf:next"));
            this.players.title("§6§l你的身份是.");
            await r.wait(10);
            this.players.title("§6§l你的身份是..");
            await r.wait(10);
            this.players.title("§6§l你的身份是...");
            await r.wait(10);
            this.players.title("§6§l你的身份是....");
            await r.wait(15);
            showRole(this.players);
            this.players.sendMessage("§a请裁判确认是否开始游戏");
            this.state.giveNextItem();
            this.state.deleteComponent(showRoleClassicView);
        });
    }
}
